import React, { PureComponent } from 'react'
import enhanceUserInfo from './hoc/enchanced_props'

// 函数组件
const Home = enhanceUserInfo(function(props) {
  return (
    <div>
      Home组件
      <div>{props.name}</div>
    </div>
  )
})

// 类组件
class Profile extends PureComponent {
  render() {
    return (
      <div>
        Profile组件
        <div>{this.props.name}</div>
      </div>
    )
  }
}
const EnhanceProfile = enhanceUserInfo(Profile)

export class App extends PureComponent {
  render() {
    return (
      <div>
        <Home></Home>
        <Profile></Profile>
        <EnhanceProfile></EnhanceProfile>
      </div>
    )
  }
}

export default App